
********************************************************************************
**ADDS CORRECTIONS TO THE ENDLINE HEADTEACHER SURVEY

* Date created : 13 March 2019
* Output file: 04 Headteacher_Survey_Endline_Clean
*
********************************************************************************
clear
set more off 

cd "[directory]/Headteacher_Survey"
use "Endline Head Teacher Survey Final.dta"

la de enumename /*removed for respondent privacy */


*Section 1. School identification
*************************************

*dropped variables with missing observations
drop subscriberid simid devicephonenum enumname_other



* Section 2. Head Teacher Identification
 **************************************
 
**201: position_201
destring position_201, replace
la de position_201lab 1 "Head Teacher" 2 "Deputy Head Teacher" 3 "Teacher Representative" 4 "Normal Teacher" -66 "Other"
la val position_201 position_201lab

drop position_201_other


**204: years_ht_exp_204
replace years_ht_exp_204 = "0" if key == "uuid:9ee99828-1634-40f7-be37-0fbd8ddef84c"
replace years_ht_exp_204 = "3" if key ==  "uuid:17b03d9d-57d6-409d-9670-6228ecc839d7"
replace years_ht_exp_204 = "8" if key ==  "uuid:0b7bf53a-0293-4263-a356-924170697266"
replace years_ht_exp_204 = "0" if key ==  "uuid:c24b4c04-0feb-46c1-8bdb-6ad5b5e6efe8"
replace years_ht_exp_204 = "13" if key ==  "uuid:869dc8e9-d860-4782-853a-f9ab3aa3d20d"
replace years_ht_exp_204 = "3" if key ==  "uuid:b82bda4a-c40e-49f0-a024-b046354964c3"
replace years_ht_exp_204 = "4" if key ==  "uuid:51831561-e0c1-46a6-bf77-22a89be6298f"
replace years_ht_exp_204 = "0" if key ==  "uuid:7f467b6e-23b7-4f9a-a12f-6965e80bbfd5"
replace years_ht_exp_204 = "7" if key ==  "uuid:61d6c337-3567-46e6-8a3b-65e8a58a6724"
replace years_ht_exp_204 = "11" if key ==  "uuid:b8ab0a9e-bae0-424e-be66-dc52ba525388"
replace years_ht_exp_204 = "0" if key ==  "uuid:a8089af2-7097-455f-8a52-b7c3ff20edff"
replace years_ht_exp_204 = "0" if key ==  "uuid:d1fd0e74-3926-4d33-9630-5b512a293c26"
replace years_ht_exp_204 = "7" if key ==  "uuid:4ec36271-a849-4c39-82cd-e19cca197f9a"
replace years_ht_exp_204 = "0" if key ==  "uuid:4b3dac76-19ee-4735-b47f-e798ff99accc"
replace years_ht_exp_204 = "5" if key ==  "uuid:6d6b4a89-165c-4fb7-be0b-058231ac5b2e"
replace years_ht_exp_204 = "7" if key ==  "uuid:72b80fa5-860a-4378-95a1-43586ee68757"
replace years_ht_exp_204 = "0" if key ==  "uuid:c1c59991-c920-4a61-bcd1-b032b88ca073"
replace years_ht_exp_204 = "10" if key ==  "uuid:f5a618b3-7b3c-4c3f-b4bf-7bc4022c8fab"
replace years_ht_exp_204 = "3" if key ==  "uuid:fbe39866-1386-4534-9f40-cd27a3d36508"
replace years_ht_exp_204 = "0" if key ==  "uuid:85f430eb-9d52-4390-b34c-9d22491c1649"
replace years_ht_exp_204 = "0" if key ==  "uuid:7d68b914-456a-4603-972c-63b57cb1cb38"
replace years_ht_exp_204 = "0" if key ==  "uuid:ed069588-39b9-4d05-9de3-058a995de00d"
replace years_ht_exp_204 = "0" if key ==  "uuid:0d6d9a16-a64d-4544-b0fa-77f5ac4bad64"
replace years_ht_exp_204 = "0" if key ==  "uuid:70f7c5e7-9313-483e-a4ad-50e08bd7cbed"
replace years_ht_exp_204 = "0" if key ==  "uuid:824366a2-6e18-4025-93a6-bf1145ab3a7a"
replace years_ht_exp_204 = "0" if key ==  "uuid:62056eda-6fde-41e2-b7dc-42f1ef7658ba"
replace years_ht_exp_204 = "0" if key ==  "uuid:d2897030-f97a-4baa-b0e1-e71fc95926da"
replace years_ht_exp_204 = "0" if key ==  "uuid:d2897030-f97a-4baa-b0e1-e71fc95926da"
replace years_ht_exp_204 = "0" if key ==  "uuid:4ea6ed1b-833a-44ae-bf90-fb4db375969d"
replace years_ht_exp_204 = "9" if key ==  "uuid:6c3bd48d-0f12-4e98-a35b-ba71ca692052"
replace years_ht_exp_204 = "0" if key ==  "uuid:050f9cda-b8ac-4b78-9e43-7ae3d28682fa"
replace years_ht_exp_204 = "0" if key ==  "uuid:445adc0e-05c5-496c-8135-29b5aa11748d"
replace years_ht_exp_204 = "0" if key ==  "uuid:abcee385-0ed4-422a-8d58-0ca8b44e5c7e"
replace years_ht_exp_204 = "0" if key ==  "uuid:0fa563ed-18c6-40db-a4e4-ef9809077d06"
replace years_ht_exp_204 = "0" if key ==  "uuid:88272175-98d6-4595-9409-93028336b525"
replace years_ht_exp_204 = "0" if key == "uuid:796b356d-d5df-4d18-add4-dfe60b289417"
replace years_ht_exp_204 = "0" if key == "uuid:037f3f91-22b4-4359-99f8-1d09550c6157"
destring years_ht_exp_204, replace

** 205:years_teach_exp_205
replace years_teach_exp_205 = "3" if key == "uuid:17b03d9d-57d6-409d-9670-6228ecc839d7"
replace years_teach_exp_205 = "45" if key == "uuid:0b7bf53a-0293-4263-a356-924170697266"
replace years_teach_exp_205 = "14" if key == "uuid:869dc8e9-d860-4782-853a-f9ab3aa3d20d"
replace years_teach_exp_205 = "7" if key == "uuid:b82bda4a-c40e-49f0-a024-b046354964c3"
replace years_teach_exp_205 = "15" if key == "uuid:51831561-e0c1-46a6-bf77-22a89be6298f"
replace years_teach_exp_205 = "37" if key == "uuid:61d6c337-3567-46e6-8a3b-65e8a58a6724"
replace years_teach_exp_205 = "7" if key == "uuid:f825a69d-db49-447c-a6f1-83f39b654933"
replace years_teach_exp_205 = "13" if key == "uuid:b8ab0a9e-bae0-424e-be66-dc52ba525388"
replace years_teach_exp_205 = "13" if key == "uuid:4ec36271-a849-4c39-82cd-e19cca197f9a"
replace years_teach_exp_205 = "13" if key == "uuid:6d6b4a89-165c-4fb7-be0b-058231ac5b2e"
replace years_teach_exp_205 = "7" if key == "uuid:72b80fa5-860a-4378-95a1-43586ee68757"
replace years_teach_exp_205 = "13" if key == "uuid:f5a618b3-7b3c-4c3f-b4bf-7bc4022c8fab"
replace years_teach_exp_205 = "15" if key == "uuid:fbe39866-1386-4534-9f40-cd27a3d36508"
replace years_teach_exp_205 = "12" if key == "uuid:62056eda-6fde-41e2-b7dc-42f1ef7658ba"
replace years_teach_exp_205 = "8" if key == "uuid:d2897030-f97a-4baa-b0e1-e71fc95926da"
replace years_teach_exp_205 = "13" if key == "uuid:6c3bd48d-0f12-4e98-a35b-ba71ca692052"
replace years_teach_exp_205 = "16" if key == "uuid:445adc0e-05c5-496c-8135-29b5aa11748d"
destring years_teach_exp_205, replace


**209: lev_taught_209_g 209_What is the level taught by ${name_209_}?
lab def yesnolbl 1 Yes 0 No
foreach var in lev_taught_209__1_1 lev_taught_209__2_1 lev_taught_209__3_1 lev_taught_209__4_1 lev_taught_209__5_1 lev_taught_209__6_1 lev_taught_209___77_1 lev_taught_209___55_1{
destring `var', replace
lab val `var' yesnolbl 
}

 
*cleaning 209. What is the highest level of education ${name_209_} has completed

foreach var in level_ed_209_1_1 level_ed_209_2_1 level_ed_209_3_1 level_ed_209_4_1 level_ed_209__55_1{
destring `var', replace 
lab val `var' yesnolbl 

}


*Cleaning 209_What is the stream of ${name_209_}?

foreach var in stream_209__a_1 stream_209__b_1 stream_209__c_1 stream_209__d_1 stream_209__e_1 stream_209___77_1 stream_209___99_1{
destring `var', replace 
lab val `var' yesnolbl 
}


*209_Which other subject does ${name_209_} teach?

foreach var in oth_subj_209__1_1 oth_subj_209__2_1 oth_subj_209__3_1 oth_subj_209__4_1 oth_subj_209__5_1 oth_subj_209__6_1 oth_subj_209__7_1 oth_subj_209__8_1 oth_subj_209__9_1 oth_subj_209__10_1 oth_subj_209__11_1 oth_subj_209__12_1 oth_subj_209__13_1 oth_subj_209___77_1 oth_subj_209__other_1{
destring `var', replace 
lab val `var' yesnolbl 
}

rename v93 oth_subj_209__other_other_lab


**Cleaning the question 209_What is the level taught by ${name_209_}?

foreach var in lev_taught_209__1_2 lev_taught_209__2_2 lev_taught_209__3_2 lev_taught_209__4_2 lev_taught_209__5_2 lev_taught_209__6_2 lev_taught_209___77_2 lev_taught_209___55_2{
destring `var', replace 
lab val `var' yesnolbl 
}


**Cleaning 209. What is the highest level of education ${name_209_} has completed

foreach var in level_ed_209_1_2 level_ed_209_2_2 level_ed_209_3_2 level_ed_209_4_2 level_ed_209__55_2{
destring `var', replace 
lab val `var' yesnolbl 
}

**Cleaning 209_What is the stream of ${name_209_}?

foreach var in stream_209__a_2 stream_209__b_2 stream_209__c_2 stream_209__d_2 stream_209__e_2 stream_209___77_2 stream_209___99_2{
destring `var', replace 
lab val `var' yesnolbl 
}

**Cleaning 209_Which other subject does ${name_209_} teach?

foreach var in oth_subj_209__1_2 oth_subj_209__2_2 oth_subj_209__3_2 oth_subj_209__4_2 oth_subj_209__5_2 oth_subj_209__6_2 oth_subj_209__7_2 oth_subj_209__8_2 oth_subj_209__7_2 oth_subj_209__8_2 oth_subj_209__9_2 oth_subj_209__10_2 oth_subj_209__11_2 oth_subj_209__12_2 oth_subj_209__13_2 oth_subj_209___77_2 oth_subj_209__other_2{
destring `var', replace 
lab val `var' yesnolbl 
}

rename v139 oth_subj_209__other_2_lab


**lev_taught_209__3: 209_What is the level taught by ${name_209_}?

foreach var in lev_taught_209__1_3 lev_taught_209__2_3 lev_taught_209__3_3 lev_taught_209__4_3 lev_taught_209__5_3 lev_taught_209__6_3 lev_taught_209___77_3 lev_taught_209___55_3{
destring `var', replace 
lab val `var' yesnolbl
}

**level_ed_209_3: 209. What is the highest level of education ${name_209_} has completed

foreach var in level_ed_209_1_3 level_ed_209_2_3 level_ed_209_3_3 level_ed_209_4_3 level_ed_209__55_3{
destring `var', replace 
lab val `var' yesnolbl 
}

**stream_209__3: 209_What is the stream of ${name_209_}?

foreach var in stream_209__a_3 stream_209__b_3 stream_209__c_3 stream_209__d_3 stream_209__e_3 stream_209___77_3 stream_209___99_3{
destring `var', replace 
lab val `var' yesnolbl 
}


**adding labels to oth_subj_209__3: 209_Which other subject does ${name_209_} teach?

foreach var in oth_subj_209__1_3 oth_subj_209__2_3 oth_subj_209__3_3 oth_subj_209__4_3 oth_subj_209__5_3 oth_subj_209__6_3 oth_subj_209__7_3 oth_subj_209__8_3 oth_subj_209__9_3 oth_subj_209__10_3 oth_subj_209__11_3 oth_subj_209__12_3 oth_subj_209__13_3 oth_subj_209___77_3 oth_subj_209__other_3{
destring `var', replace 
lab val `var' yesnolbl 
}

rename v185 oth_subj_209__other_3_lab


*============================
**adding labels on lev_taught_209__4 : 209_What is the level taught by ${name_209_}?

foreach var in lev_taught_209__1_4 lev_taught_209__2_4 lev_taught_209__3_4 lev_taught_209__4_4 lev_taught_209__5_4 lev_taught_209__6_4 lev_taught_209___77_4 lev_taught_209___55_4{
destring `var', replace 
lab val `var' yesnolbl 
}


**level_ed_209_4: 209. What is the highest level of education ${name_209_} has completed

foreach var in level_ed_209_1_4 level_ed_209_2_4 level_ed_209_3_4 level_ed_209_4_4 level_ed_209__55_4{
destring `var', replace 
lab val `var' yesnolbl 
}


**stream_209__4: 209_What is the stream of ${name_209_}?

foreach var in stream_209__a_4 stream_209__b_4 stream_209__c_4 stream_209__d_4 stream_209__e_4 stream_209___77_4 stream_209___99_4{
destring `var', replace 
lab val `var' yesnolbl 
}

**adding labels to oth_subj_209__4: 209_Which other subject does ${name_209_} teach?

foreach var in oth_subj_209__1_4 oth_subj_209__2_4 oth_subj_209__3_4 oth_subj_209__4_4 oth_subj_209__5_4 oth_subj_209__6_4 oth_subj_209__7_4 oth_subj_209__8_4 oth_subj_209__9_4 oth_subj_209__10_4 oth_subj_209__11_4 oth_subj_209__12_4 oth_subj_209__13_4 oth_subj_209___77_4 oth_subj_209__other_4{
destring `var', replace 
lab val `var' yesnolbl 
}

rename v231 oth_subj_209__other_4_lab



**gender_209__5: 209_What is the gender of ${name_209_}?

foreach var in lev_taught_209__1_5 lev_taught_209__2_5 lev_taught_209__3_5 lev_taught_209__4_5 lev_taught_209__5_5 lev_taught_209__6_5 lev_taught_209___77_5 lev_taught_209___55_5{
destring `var', replace
lab val `var' yesnolbl  
}


**level_ed_209_5: 209. What is the highest level of education ${name_209_} has completed

foreach var in level_ed_209_1_5 level_ed_209_2_5 level_ed_209_3_5 level_ed_209_4_5 level_ed_209__55_5{
destring `var', replace 
lab val `var' yesnolbl 
}


**stream_209__5: 209_What is the stream of ${name_209_}?

foreach var in stream_209__a_5 stream_209__b_5 stream_209__c_5 stream_209__d_5 stream_209__e_5 stream_209___77_5 stream_209___99_5{
destring `var', replace 
lab val `var' yesnolbl 
}


**adding labels to oth_subj_209__5: 209_Which other subject does ${name_209_} teach?

foreach var in oth_subj_209__1_5 oth_subj_209__2_5 oth_subj_209__3_5 oth_subj_209__4_5 oth_subj_209__5_5 oth_subj_209__6_5 oth_subj_209__7_5 oth_subj_209__8_5 oth_subj_209__9_5 oth_subj_209__10_5 oth_subj_209__11_5 oth_subj_209__12_5 oth_subj_209__13_5 oth_subj_209___77_5 oth_subj_209__other_5{
destring `var', replace 
lab val `var' yesnolbl 
}

rename v277 oth_subj_209__other_5_lab

*****
**cleaning 209_What is the level taught by ${name_209_}?

foreach var in lev_taught_209__1_6 lev_taught_209__2_6 lev_taught_209__3_6 lev_taught_209__4_6 lev_taught_209__5_6 lev_taught_209__6_6 lev_taught_209___77_6 lev_taught_209___55_6{
destring `var', replace 
lab val `var' yesnolbl 
}

*cleaning 209. What is the highest level of education ${name_209_} has completed

foreach var in level_ed_209_1_6 level_ed_209_2_6 level_ed_209_3_6 level_ed_209_4_6 level_ed_209__55_6{
destring `var', replace 
lab val `var' yesnolbl 
}

**stream_209__5: 209_What is the stream of ${name_209_}?

foreach var in stream_209__a_6 stream_209__b_6 stream_209__c_6 stream_209__d_6 stream_209__e_6 stream_209___77_6 stream_209___99_6{
destring `var', replace 
lab val `var' yesnolbl 
}

*********************

foreach var in oth_subj_209__1_6 oth_subj_209__2_6 oth_subj_209__3_6 oth_subj_209__4_6 oth_subj_209__5_6 oth_subj_209__6_6 oth_subj_209__7_6 oth_subj_209__8_6 oth_subj_209__9_6 oth_subj_209__10_6 oth_subj_209__11_6 oth_subj_209__12_6 oth_subj_209__13_6 oth_subj_209___77_6 oth_subj_209__other_6{
destring `var', replace 
lab val `var' yesnolbl 
}

rename v323 oth_subj_209_spec_other_6


**********

foreach var in lev_taught_209__1_7 lev_taught_209__2_7 lev_taught_209__3_7 lev_taught_209__4_7 lev_taught_209__5_7 lev_taught_209__6_7 lev_taught_209___77_7 lev_taught_209___55_7{
destring `var', replace 
lab val `var' yesnolbl 
}


**
foreach var in level_ed_209_1_7 level_ed_209_2_7 level_ed_209_3_7 level_ed_209_4_7 level_ed_209__55_7{
destring `var', replace 
lab val `var' yesnolbl 
}


**stream_209__5: 209_What is the stream of ${name_209_}?

foreach var in stream_209__a_7 stream_209__b_7 stream_209__c_7 stream_209__d_7 stream_209__e_7 stream_209___77_7 stream_209___99_7{
destring `var', replace 
lab val `var' yesnolbl 
}


**adding labels to oth_subj_209__5: 209_Which other subject does ${name_209_} teach?

foreach var in oth_subj_209__1_7 oth_subj_209__2_7 oth_subj_209__3_7 oth_subj_209__4_7 oth_subj_209__5_7 oth_subj_209__6_7 oth_subj_209__7_7 oth_subj_209__8_7 oth_subj_209__9_7 oth_subj_209__10_7 oth_subj_209__11_7 oth_subj_209__12_7 oth_subj_209__13_7 oth_subj_209___77_7 oth_subj_209__other_7{
destring `var', replace 
lab val `var' yesnolbl 

}

drop lead_pro_dev_other


*****************************************
*1	Physics 
*2	Chemistry
*3	Maths
*4	Biology
*5	Geography
*6	Economics
*7	History
*8	English
*9	French
*10	Kinyarwanda
*11	Kiswahili
*12	Computer Science
*13	Literature
*-77	n/a
*****************************************


***Section 5. Pedagogy Competence-Based Curriculum 
**************************************************

*cleaning 500_What are the three (3) teaching methods or pedagogies your teachers are most

foreach var in teach_meth_mostcomf_1 teach_meth_mostcomf_2 teach_meth_mostcomf_3 teach_meth_mostcomf_4 teach_meth_mostcomf_5 teach_meth_mostcomf_6 teach_meth_mostcomf_7 teach_meth_mostcomf_8 teach_meth_mostcomf_9 teach_meth_mostcomf_10 teach_meth_mostcomf_11 teach_meth_mostcomf__55{
lab var `var' "500_What are the three (3) teaching methods or pedagogies your teachers are most"
lab val `var' yesnolbl 
notes `var': "500_What are the three (3) teaching methods or pedagogies that entrepreneurship teachers in your school are most comfortable using?"
}

************************************************
*1	Lecture or note taking
*2	Question & Answer
*3	Quiz or Exam
*4	Small Group Work
*5	Games (e.g: energizers, competitions, cards, etc)
*6	Class Discussion
*7	Activities outside of the classroom
*8	Reading from a text
*9	Practice exercises
*10	Research (use of library or computer)
*11	Experiment
*12	Student Portfolio
****************************************************



**cleaning 501_What are the three (3) teaching methods or pedagogies your teachers are leas

foreach var in teach_meth_leastcomf_1 teach_meth_leastcomf_2 teach_meth_leastcomf_3 teach_meth_leastcomf_4 teach_meth_leastcomf_5 teach_meth_leastcomf_6 teach_meth_leastcomf_7 teach_meth_leastcomf_8 teach_meth_leastcomf_9 teach_meth_leastcomf_10 teach_meth_leastcomf__55{
lab var `var' "501_What are the three (3) teaching methods or pedagogies your teachers are leas"
lab val `var' yesnolbl 
notes `var': "501_What are the three (3) teaching methods or pedagogies your entrepreneurship teachers are least comfortable using?"
}

**cleaning goal_teach_602: 502_In your opinion, what do you think teachers’ goals should be for their stude

foreach var in goal_teach_602_1 goal_teach_602_2 goal_teach_602_3 goal_teach_602_4 goal_teach_602__66{
la val `var' yesnolbl 
notes `var': "502_In your opinion, what do you think teachers’ goals should be for their students? Rank the following goals in terms of importance."
}


**adding labels to goal_teach_603 : 503_In your school, what are teachers’ goals for their students? Rank the follow
foreach var in goal_teach_603_1 goal_teach_603_2 goal_teach_603_3 goal_teach_603_4 goal_teach_603__66{
la val `var' yesnolbl 
notes `var': "503_In your school, what are teachers’ goals for their students? Rank the following goals in terms of importance"
}


**adding labels meth_3_607 : 504_Which three (3) teaching methods do you believe are most effective for teach

foreach var in meth_3_607_1 meth_3_607_2 meth_3_607_3 meth_3_607_4 meth_3_607_5 meth_3_607_6 meth_3_607_7 meth_3_607_8 meth_3_607_9 meth_3_607_10 meth_3_607_11 meth_3_607_12 meth_3_607__55{
la var `var' "504_Which three (3) teaching methods do you believe are most effective for teach"
la val `var' yesnolbl 
notes `var': "504_Which three (3) teaching methods do you believe are most effective for teaching entrepreneurship subject?"
}



**adding labels to meth_3_605 : 505_Which three (3) teaching methods do you believe are least effective for teac
foreach var in meth_3_605_1 meth_3_605_2 meth_3_605_3 meth_3_605_4 meth_3_605_5 meth_3_605_6 meth_3_605_7 meth_3_605_8 meth_3_605_9 meth_3_605_10 meth_3_605_11 meth_3_605_12 meth_3_605__55{
la var `var' "505_Which three (3) teaching methods do you believe are least effective for teac"
lab val `var' yesnolbl 
notes `var': "505_Which three (3) teaching methods do you believe are least effective for teaching entrepreneurship subject?"
}


**adding labels to teach_resource

foreach var in teach_resource_1 teach_resource_2 teach_resource_3 teach_resource_4 teach_resource_5 teach_resource_6{
la var `var' "506. Teacher resources"
lab val `var' yesnolbl 
notes `var': "506. Teacher resources"
}


//IDs
destring schoolid, replace
tostring schoolid, replace
drop if schoolid == "605118" & key == "uuid:45d59c0e-4017-433c-b65e-d9d033f4f376"
gen myidstr = "0" + schoolid
merge 1:1 myidstr using "ht_addedbasinfo.dta"
drop if _merge == 2
drop _merge
rename myidstr schoolid_bas
order province district sector cell village school schoolid_bas distrloc_106 publ_priv_108 board_day_109 group_110, after(reenter_schoolid)
order schoolid_bas, after(reenter_schoolid)


**Sectio 3. School Finances and Resources 
*****************************************

**textb_govt_302
replace textb_govt_302 = "0" if key == "uuid:8901a818-902f-4003-a9f0-77af9eb63514"
replace textb_govt_302 = "3560" if key == "uuid:17b03d9d-57d6-409d-9670-6228ecc839d7"
replace textb_govt_302 = "-99" if key == "uuid:4a08b37b-b516-4020-9cb6-06a96744b4ed"
replace textb_govt_302 = "752" if key == "uuid:20dd8f2d-74a9-4a01-984f-456a9610fd41"
replace textb_govt_302 = "-99" if key == "uuid:b98769f8-888c-4f34-b81c-66d61557076a"
replace textb_govt_302 = "-99" if key == "uuid:6b5686d9-859b-4837-8e9c-e3bd036aedc5"
destring textb_govt_302, replace


**textb_ngo_302
replace textb_ngo_302 = "0" if key == "uuid:b98769f8-888c-4f34-b81c-66d61557076a"
replace textb_ngo_302 = "98" if key == "uuid:17b03d9d-57d6-409d-9670-6228ecc839d7"
destring textb_ngo_302, replace

**textb_committee_302
replace textb_committee_302 = "0" if key == "uuid:b98769f8-888c-4f34-b81c-66d61557076a"
replace textb_committee_302 = "0" if key == "uuid:8901a818-902f-4003-a9f0-77af9eb63514"
replace textb_committee_302 = "0" if key == "uuid:b98769f8-888c-4f34-b81c-66d61557076a"
replace textb_committee_302 = "" if key == "uuid:8901a818-902f-4003-a9f0-77af9eb63514"
destring textb_committee_302, replace

**money_govt_302
replace money_govt_302 = "30020000" if key == "uuid:9cd1a7de-5105-4540-baab-3632bd3fbd63"
replace money_govt_302 = "13697314" if key == "uuid:360ae3c1-8a51-44a4-964c-db235f9fef72"
replace money_govt_302 = "11179574" if key == "uuid:f5a618b3-7b3c-4c3f-b4bf-7bc4022c8fab"
replace money_govt_302 = "3618650" if key == "uuid:2cf60b06-1744-4bad-8ac8-dd9d9285987c"
replace money_govt_302 = "6088549" if key == "uuid:72b80fa5-860a-4378-95a1-43586ee68757"
replace money_govt_302 = "7046768" if key == "uuid:844c8a00-f8e3-47f4-8ca8-31ee4c717186"
replace money_govt_302 = "15670691" if key == "uuid:4ec36271-a849-4c39-82cd-e19cca197f9a"
replace money_govt_302 = "5623020" if key == "uuid:5f1fffb1-f1cc-4a6a-9902-9cf79aa35e20"
replace money_govt_302 = "8831359" if key == "uuid:6d6b4a89-165c-4fb7-be0b-058231ac5b2e"
replace money_govt_302 = "1060500" if key == "uuid:2e2ed25b-7b2d-4646-a47c-c064e47bc769"
replace money_govt_302 = "4855784" if key == "uuid:724eb710-472b-429c-992e-59e276ea6cd4"
replace money_govt_302 = "720000" if key == "uuid:7f467b6e-23b7-4f9a-a12f-6965e80bbfd5"
replace money_govt_302 = "8528948" if key == "uuid:c24b4c04-0feb-46c1-8bdb-6ad5b5e6efe8"
replace money_govt_302 = "1419375" if key == "uuid:6a7868be-fd2f-4859-baa2-82d9acd3058a"
replace money_govt_302 = "6942250" if key == "uuid:f825a69d-db49-447c-a6f1-83f39b654933"
replace money_govt_302 = "4751000" if key == "uuid:20dd8f2d-74a9-4a01-984f-456a9610fd41"
replace money_govt_302 = "-99" if key == "uuid:b98769f8-888c-4f34-b81c-66d61557076a"
replace money_govt_302 = "2089800" if key == "uuid:5840eb2b-6306-4f9a-a6af-53d40e45e4bd"
replace money_govt_302 = "807975" if key == "uuid:bb37e1cd-b0d4-4330-a8d3-b5e0a29385e7"
replace money_govt_302 = "9304315" if key == "uuid:43eb378f-6ffb-419a-982a-21d33f8f21a3"
replace money_govt_302 = "12000000" if key == "uuid:6c3bd48d-0f12-4e98-a35b-ba71ca692052"
replace money_govt_302 = "11166245" if key == "uuid:684bce8f-224e-497a-b4ad-f5038eb45adb"
replace money_govt_302 = "6393756" if key == "uuid:0d6d9a16-a64d-4544-b0fa-77f5ac4bad64"
replace money_govt_302 = "12095756" if key == "uuid:70f7c5e7-9313-483e-a4ad-50e08bd7cbed"
replace money_govt_302 = "15852608" if key == "uuid:7d68b914-456a-4603-972c-63b57cb1cb38"
replace money_govt_302 = "3955841" if key == "uuid:e338fd2d-0fbc-4276-9284-0e585b839c01"
replace money_govt_302 = "10849375" if key == "uuid:2e27968c-5980-40e6-8826-98a448ea5ce0"
replace money_govt_302 = "9400188" if key == "uuid:6abe826e-2d2b-43d4-8daf-8b83068acbed"
replace money_govt_302 = "0" if key == "uuid:8901a818-902f-4003-a9f0-77af9eb63514"
replace money_govt_302 = "17419680" if key == "uuid:17b03d9d-57d6-409d-9670-6228ecc839d7"
replace money_govt_302 = "2646270" if key == "uuid:338a2c77-0758-45c1-8a68-1c5bc3ba0b7f"
replace money_govt_302 = "-99" if key == "uuid:b82bda4a-c40e-49f0-a024-b046354964c3"
replace money_govt_302 = "-99" if key == "uuid:4a08b37b-b516-4020-9cb6-06a96744b4ed"
replace money_govt_302 = "-99" if key == "uuid:6b5686d9-859b-4837-8e9c-e3bd036aedc5"
replace money_govt_302 = "-99" if key == "uuid:799a215e-62f1-4341-bdcb-0cab26ad71cb"
destring money_govt_302, replace

*money_ngo_302
replace money_ngo_302 = "2211821" if key == "uuid:f5a618b3-7b3c-4c3f-b4bf-7bc4022c8fab"
replace money_ngo_302 = "633950" if key == "uuid:f825a69d-db49-447c-a6f1-83f39b654933"
replace money_ngo_302 = "0" if key == "uuid:b98769f8-888c-4f34-b81c-66d61557076a"
replace money_ngo_302 = "132000" if key == "uuid:bb37e1cd-b0d4-4330-a8d3-b5e0a29385e7"
replace money_ngo_302 = "939500" if key == "uuid:6c3bd48d-0f12-4e98-a35b-ba71ca692052"
replace money_ngo_302 = "1930000" if key == "uuid:684bce8f-224e-497a-b4ad-f5038eb45adb"
replace money_ngo_302 = "9898062" if key == "uuid:606ac856-e09e-46d2-a5fd-74f338259806"
replace money_ngo_302 = "0" if key == "uuid:8901a818-902f-4003-a9f0-77af9eb63514"
destring money_ngo_302, replace

**money_committee_302
replace money_committee_302 = "90000" if key == "uuid:9cd1a7de-5105-4540-baab-3632bd3fbd63"
replace money_committee_302 = "0" if key == "uuid:b98769f8-888c-4f34-b81c-66d61557076a"
replace money_committee_302 = "0" if key == "uuid:078c9cbe-636f-4a20-93d2-0caa368a02b2"
replace money_committee_302 = "14088000" if key == "uuid:70f7c5e7-9313-483e-a4ad-50e08bd7cbed"
replace money_committee_302 = "9096000" if key == "uuid:2e27968c-5980-40e6-8826-98a448ea5ce0"
replace money_committee_302 = "0" if key == "uuid:8901a818-902f-4003-a9f0-77af9eb63514"
replace money_committee_302 = "-99" if key == "uuid:35c4ab9d-ddc0-4013-865d-fa8dc959885a"
replace money_committee_302 = "-99" if key == "uuid:ad126b77-e749-4fb5-b454-ab1633cd098c"
replace money_committee_302 = "-99" if key == "uuid:4a08b37b-b516-4020-9cb6-06a96744b4ed"
destring money_committee_302, replace


replace schoolid = "301015" if schoolid == "3051015"
replace reenter_schoolid = 301015 if reenter_schoolid == 3051015
replace province = 3 if reenter_schoolid == 301015
replace district = 9 if reenter_schoolid == 301015
replace sector = 110 if reenter_schoolid == 301015
replace cell = 163 if reenter_schoolid == 301015
replace village = 168 if reenter_schoolid == 301015
replace school = 174 if reenter_schoolid == 301015 & school == .
replace distrloc_106 = 1 if reenter_schoolid == 301015 & distrloc_106 == .
replace publ_priv_108 = 1 if reenter_schoolid == 301015 & publ_priv_108 == .

replace board_day_109 = 1 if reenter_schoolid == 301015 & board_day_109 == .
replace group_110 = 2 if reenter_schoolid == 301015 & group_110 == .


replace schoolid = "401133" if schoolid == "40113310"
replace reenter_schoolid = 401133 if reenter_schoolid == 40113310
replace province = 2 if reenter_schoolid == 401133
replace district = 8 if reenter_schoolid == 401133
replace sector = 98 if reenter_schoolid == 401133
replace cell = 138 if reenter_schoolid == 401133
replace village = 143 if reenter_schoolid == 401133
replace school = 147 if reenter_schoolid == 401133 & school == .
replace distrloc_106 = 1 if reenter_schoolid == 401133 & distrloc_106 == .
replace publ_priv_108 = 1 if reenter_schoolid == 401133 & publ_priv_108 == .

replace board_day_109 = 2 if reenter_schoolid == 401133 & board_day_109 == .
replace group_110 = 2 if reenter_schoolid == 401133 & group_110 == .



replace province = 2 if reenter_schoolid == 504102
replace district = 6 if reenter_schoolid == 504102
replace sector = 61 if reenter_schoolid == 504102
replace cell = 89 if reenter_schoolid == 504102
replace village = 91 if reenter_schoolid == 504102
replace school = 95 if reenter_schoolid == 504102
replace distrloc_106 = 1 if reenter_schoolid == 504102
replace publ_priv_108 = 3 if reenter_schoolid == 504102

replace board_day_109 = 2 if reenter_schoolid == 504102
replace group_110 = 1 if reenter_schoolid == 504102 



replace province = 1 if reenter_schoolid == 5041021
replace district = 3 if reenter_schoolid == 5041021
replace sector = 26 if reenter_schoolid == 5041021
replace cell = 42 if reenter_schoolid == 5041021
replace village = 43 if reenter_schoolid == 5041021
replace school = 45 if reenter_schoolid == 5041021
replace distrloc_106 = 2 if reenter_schoolid == 5041021
replace publ_priv_108 = 3 if reenter_schoolid == 5041021

replace board_day_109 = 2 if reenter_schoolid == 5041021
replace group_110 = 2 if reenter_schoolid == 5041021 



replace province = 1 if reenter_schoolid == 605118
replace district = 4 if reenter_schoolid == 605118
replace sector = 49 if reenter_schoolid == 605118
replace cell = 75 if reenter_schoolid == 605118
replace village = 77 if reenter_schoolid == 605118
replace school = 80 if reenter_schoolid == 605118 & school == .
replace distrloc_106 = 1 if reenter_schoolid == 605118 & distrloc_106 == .
replace publ_priv_108 = 1 if reenter_schoolid == 605118 & publ_priv_108 == .

replace board_day_109 = 2 if reenter_schoolid == 401133 & board_day_109 == .
replace group_110 = 1 if reenter_schoolid == 401133 & group_110 == .


replace province = 1 if reenter_schoolid == 5070118
replace district = 1 if reenter_schoolid == 5070118
replace sector = 3 if reenter_schoolid == 5070118
replace cell = 5 if reenter_schoolid == 5070118
replace village = 5 if reenter_schoolid == 5070118
replace school = 5 if reenter_schoolid == 5070118 & school == .
replace distrloc_106 = 1 if reenter_schoolid == 5070118 & distrloc_106 == .
replace publ_priv_108 = 3 if reenter_schoolid == 5070118 & publ_priv_108 == .

replace board_day_109 = 3 if reenter_schoolid == 5070118 & board_day_109 == .
replace group_110 = 1 if reenter_schoolid == 5070118 & group_110 == .


//correcting non-matching endline IDs with baseline IDs
replace schoolid = "504102" if schoolid == "5041021"
replace schoolid = "507118" if schoolid == "5070118"
replace schoolid = "506118" if schoolid == "605118"
replace schoolid = "405102" if key == "uuid:236263b8-0f86-4dc7-9ff6-397aac0f1d5c"

replace reenter_schoolid = 504102 if reenter_schoolid == 5041021
replace reenter_schoolid = 507118 if reenter_schoolid == 5070118
replace reenter_schoolid = 506118 if reenter_schoolid == 605118
replace reenter_schoolid = 405102 if key == "uuid:236263b8-0f86-4dc7-9ff6-397aac0f1d5c"


//dropped these varaibles as they were corrected 
drop province_100 district_101 sector_102 cell_103 village_104 school_105 deviceid
rename school school_105

//gen new school_code_107 which is schoolid in line with baseline

gen school_code_107 = "0" 
replace school_code_107 = "0" + schoolid

order school_code_107, after(schoolid)
*drop schoolid_bas reenter_schoolid
